/*
 Navicat Premium Data Transfer

 Source Server         : 法雷奥考勤库
 Source Server Type    : SQL Server
 Source Server Version : 13004001
 Source Host           : 192.168.2.221:1433
 Source Catalog        : scm_main
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13004001
 File Encoding         : 65001

 Date: 23/12/2019 17:52:06
*/


-- ----------------------------
-- Table structure for bd_dep_card_use
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bd_dep_card_use]') AND type IN ('U'))
	DROP TABLE [dbo].[bd_dep_card_use]
GO

CREATE TABLE [dbo].[bd_dep_card_use] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [applicant_id] bigint  NOT NULL,
  [dep_id] bigint  NOT NULL,
  [card_serial] char(8) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [applicant_date] date  NULL,
  [register_repast_count] int  NULL,
  [whether_deleted] int DEFAULT ((0)) NULL,
  [creation_time] datetime DEFAULT (getdate()) NULL
)
GO

ALTER TABLE [dbo].[bd_dep_card_use] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键id',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'申请人ID',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'applicant_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门ID',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'dep_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'卡id',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'card_serial'
GO

EXEC sp_addextendedproperty
'MS_Description', N'申请日期',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'applicant_date'
GO

EXEC sp_addextendedproperty
'MS_Description', N'登记就餐次数',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'register_repast_count'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否删除  0不删除 1删除',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'whether_deleted'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use',
'COLUMN', N'creation_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门卡使用申请',
'SCHEMA', N'dbo',
'TABLE', N'bd_dep_card_use'
GO


-- ----------------------------
-- Primary Key structure for table bd_dep_card_use
-- ----------------------------
ALTER TABLE [dbo].[bd_dep_card_use] ADD CONSTRAINT [PK_BD_DEP_CARD_USE] PRIMARY KEY CLUSTERED ([id], [applicant_id], [dep_id], [card_serial])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

